package com.controller.medical;

import com.comm.R;
import com.comm.vo.DrugTableVo;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/medicine/message")
@Api(value = "药品进销存模块",tags = "药品信息维护的所有接口API")
@ApiResponses({
        @ApiResponse(code=200,message="请求成功"),
        @ApiResponse(code=404,message="找不到页面"),
        @ApiResponse(code=405,message="请求方法错误"),
        @ApiResponse(code=500,message="后台服务错误")
})
public class DrugController {

    //查询药品信息
    @RequestMapping(value = "/findDrugList",method = RequestMethod.GET)
    @ApiOperation(value = "查询药品信息",notes = "查询药品信息",httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页的条数",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "drugName",value = "药品名称",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "drugSort",value = "药品分类",paramType = "query",dataType = "String",required = true)
    })

    public String findDrugList(@ApiParam() String currentPage,String pageSize,String drugName,String drugSort) {
        return "{\n" +
                "\t\"drug_name\": \"烫骨碎补\",\n" +
                "\t\"classify\": \"中草药\",\n" +
                "\t\"number\": 1,\n" +
                "\t\"remark\": \"g\",\n" +
                "\t\"sepc\": \"1g\",\n" +
                "\t\"create_date\": \"2023 - 02 - 17 16: 01: 09\"\n" +
                "}";
    }

    //导入药品信息
    @RequestMapping(value = "/addDrug",method = RequestMethod.POST)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "状态",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "status",value = "状态",paramType = "query",dataType = "int",required = true)
    })
    @ApiOperation(value = "导入药品信息",notes = "导入药品信息",httpMethod = "post", response = R.class)

    @ResponseBody
    public R addDrug() {
        R r = new R();
        r.setCode(200);
        r.setMsg("导入成功");
        return r;
    }

    //删除药品信息
    @RequestMapping(value = "/deleteDrug",method = RequestMethod.POST)
    @ApiOperation(value = "添加删除药品信息接口",notes = "传递信息",httpMethod = "post", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "状态",paramType = "query",dataType = "int",required = true),
            @ApiImplicitParam(name = "status",value = "状态",paramType = "query",dataType = "int",required = true)
    })
    @ResponseBody
    public R deleteDrug() {
        R r = new R();
        r.setCode(200);
        r.setMsg("删除成功");
        return r;
    }


}
